<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			img{
				width: 100px;
				height: 100px;
				position: absolute;
			}
		</style>
		<script src="../课件/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function(){
				$('img').mousedown(function(e){
					var disX = e.clientX - $('img').offset().left;
					var disY = e.clientY - $('img').offset().top;
					$(document).mousemove(function(e){
						e.preventDefault()
						$('img').css({left:e.clientX-disX,top:e.clientY-disY})
					});
					$(document).mouseup(function(){
						
						$(document).unbind('mousemove');
						$(document).unbind('mouseup');
					})
				})
			})
		</script>
	</head>
	<body>
		<img src="day4/hg.jpg"/>
	</body>
</html>
